package com.lp.feign;

import lombok.NonNull;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClientConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "article", configuration = LoadBalancerClientConfiguration.class)
public interface ArticleClients {

    @LoadBalanced
    @GetMapping("/article/user_stat")
    String userStat(@RequestParam("userId") Long userId);

    /**
     * 获取数据 (Article + User(nickname + photo)
     * @param id 文章 id
     * @return
     */
    @LoadBalanced
    @GetMapping("/article/es_vo")
    String ESVO(@RequestParam("id") @NonNull Long id);

    @LoadBalanced
    @GetMapping("/article/get_article_stat")
    String getArticleStat(@RequestParam("id") @NonNull Long id);

}
